import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class test9 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(); // 数组个数
        int[] nums = new int[n];
        for (int i = 0; i < n; i++) {
            nums[i] = in.nextInt();
        }
        System.out.println(singleNumber(nums));
    }
    
    public static int singleNumber(int[] nums) {
        // 用哈希表,因为之后有一个只会出现一次
        HashMap<Integer,Integer> hashMap = new HashMap<>(); // 数字,出现次数
        int flag=0;
        for (int i = 0; i < nums.length; i++) {
            if(!hashMap.containsKey(nums[i]))
                hashMap.put(nums[i],1);
            else if (hashMap.get(nums[i])==1)
                hashMap.put(nums[i],2);
        }
        for (Map.Entry<Integer,Integer> entry : hashMap.entrySet()){
            if(entry.getValue().equals(1)){
                flag = entry.getKey();
                break;
            }
        }
        return flag;
    }
}
